package com.sqlcheck.dto.response;

import com.sqlcheck.common.enums.UserRole;
import lombok.Data;
import lombok.Builder;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import io.swagger.v3.oas.annotations.media.Schema;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "登录响应")
public class LoginResponse {

    @Schema(description = "访问令牌", example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...")
    private String token;

    @Schema(description = "用户信息")
    private UserInfo userInfo;

    @Schema(description = "令牌过期时间（毫秒）", example = "86400000")
    private Long expiresIn;

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    @Schema(description = "用户基本信息")
    public static class UserInfo {

        @Schema(description = "用户ID", example = "1")
        private Long id;

        @Schema(description = "员工工号", example = "123456")
        private String employeeId;

        @Schema(description = "用户名", example = "张三")
        private String username;

        @Schema(description = "邮箱", example = "zhangsan@company.com")
        private String email;

        @Schema(description = "头像URL", example = "https://example.com/avatar.png")
        private String avatarUrl;

        @Schema(description = "用户角色", example = "USER")
        private UserRole role;
    }
}